package cn.edu.jxyy.batistest.test;

import cn.edu.jxyy.batistest.mapper.StudentMapper;
import cn.edu.jxyy.batistest.pojo.Customer;
import cn.edu.jxyy.batistest.pojo.Student;
import cn.edu.jxyy.batistest.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class Part14_Student {
//    向学生t_student表根据学生姓名查询学生信息
    public static void main(String[] args) {
        // 创建SqlSessionFactory对象
        SqlSession session = MyBatisUtils.getSession();
        StudentMapper StudentMapper = session.getMapper(StudentMapper.class);
        Student student =new Student();
        student.setId(3);
        student.setName(null);
        student.setAge(null);

        List<Student> studentList = StudentMapper.findStudent(student);
        // 输出查询结果信息
        for (Student student2 : studentList) {
            // 打印输出结果
            System.out.println(student2);
        }
        session.close();

    }

}
